package com.info.widgets.Sign;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.info.widgets.ConnectionHelper;
import com.info.widgets.DAOException;

public class SignService {


	public ArrayList<Sign> create(Sign signin) throws DAOException {
		Sign  signin1=new Sign();
		Connection con = null;
		String dbtime = null;
		String query = "SELECT * FROM mycaspian.sign_in";
		ArrayList<Sign> arrayList = new ArrayList<Sign>();
		try {
		con = ConnectionHelper.getConnection();
		Statement stmt = con.createStatement();
		ResultSet rs = stmt.executeQuery(query);

		while (rs.next()) {
			 
			
			String UName=rs.getString(2);
			signin1.setUserName(UName);
			
		System.out.println("PPPP->>"+signin1.getUserName());
		arrayList.add(signin1);
		} //end while
		
		
		} catch (Exception e) {
			e.printStackTrace();
			throw new DAOException(e);
		} finally {
			ConnectionHelper.close(con);
		}
		return arrayList;
	}

	
	

}